package com.ruoyi.pcwl.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.pcwl.domain.WebchatUser;
import com.ruoyi.pcwl.mapper.WebchatUserMapper;
import com.ruoyi.pcwl.service.IWebchatUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 微信用户Service业务层处理
 *
 * @author ruoyi
 * @date 2023-07-04
 */
@Service
public class WebchatUserServiceImpl extends ServiceImpl<WebchatUserMapper, WebchatUser> implements IWebchatUserService
{

    /**
     * 查询微信用户
     *
     * @param id 微信用户主键
     * @return 微信用户
     */
    @Override
    public WebchatUser selectWebchatUserById(Long id)
    {
        return baseMapper.selectWebchatUserById(id);
    }

    /**
     * 查询微信用户列表
     *
     * @param webchatUser 微信用户
     * @return 微信用户
     */
    @Override
    public List<WebchatUser> selectWebchatUserList(WebchatUser webchatUser)
    {
        return baseMapper.selectWebchatUserList(webchatUser);
    }

    /**
     * 新增微信用户
     *
     * @param webchatUser 微信用户
     * @return 结果
     */
    @Override
    public int insertWebchatUser(WebchatUser webchatUser)
    {
        webchatUser.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertWebchatUser(webchatUser);
    }

    /**
     * 修改微信用户
     *
     * @param webchatUser 微信用户
     * @return 结果
     */
    @Override
    public int updateWebchatUser(WebchatUser webchatUser)
    {
        webchatUser.setUpdateTime(DateUtils.getNowDate());
        return baseMapper.updateWebchatUser(webchatUser);
    }

    /**
     * 批量删除微信用户
     *
     * @param ids 需要删除的微信用户主键
     * @return 结果
     */
    @Override
    public int deleteWebchatUserByIds(Long[] ids)
    {
        return baseMapper.deleteWebchatUserByIds(ids);
    }

    /**
     * 删除微信用户信息
     *
     * @param id 微信用户主键
     * @return 结果
     */
    @Override
    public int deleteWebchatUserById(Long id)
    {
        return baseMapper.deleteWebchatUserById(id);
    }
}
